package cn.itheima.mapper;

import cn.itheima.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author 董代恒
 * @version 1.0
 */
@Mapper
public interface UserMapper {
    @Select("select * from user where username=#{username}")
    User findByUsername(String username);

    @Insert("insert into user(username, password, create_time, update_time) " +
            " VALUES (#{username},#{password},now(),now())")
    void add(@Param("username") String username,@Param("password") String password);
}
